<?php

/*
 * Para usar precisa das classes da biblioteca
 * PHP Mailer, porém o envio de email não é
 * possui grande prioridade
 */

class TrataEnvioDeEmail {

    private $dados_email;
    private $templateEmail;
    private $assuntoEmail;
    private $emailFrom;

    public function __construct($dados_email, $templateEmail, $assuntoEmail, $emailFrom) {
        $this->dados_email= $dados_email;
        $this->templateEmail = $templateEmail;
        $this->assuntoEmail = $assuntoEmail;
        $this->emailFrom = $emailFrom;
    }

    function enviaEmailUsuario($dados_email, $templateEmail, $assuntoEmail, $emailFrom, $emailHtml = true) {
        global $config;
        $body = templateParametrizado($templateEmail, $dados_email);
        require_once ($config["local_resources"] . "/classes/class.phpmailer.php");
        $mail = new PHPMailer();
        $mail->CharSet = "UTF-8";
        $mail->SMTPDebug = 0;
        $mail->Host = 'upmaker.com';
        $mail->isHTML(true);
        $mail->SetFrom($emailFrom);
        $mail->Subject = $assuntoEmail . " | " . $config["nomesite"];
        $mail->Body = $body;
        $mail->AddAddress($dados_email['CLIENTE_EMAIL']);
        $mail->Send();
    }

}
?>
